package com.interactive1.dbutils;

import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.NClob;
import java.sql.SQLClientInfoException;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.SQLXML;
import java.sql.Savepoint;
import java.sql.Struct;
import java.util.Map;
import java.util.Properties;

import com.mysql.jdbc.CallableStatement;
import com.mysql.jdbc.DatabaseMetaData;
import com.mysql.jdbc.PreparedStatement;
import com.mysql.jdbc.Statement;


public class DummyConnection implements Connection {
	
	boolean closed = false;
	
	public int getHoldability() {
		return 0;
	}
	
	public void setHoldability(int a) {
		if (a==0) {}
	}

	public Statement createStatement() throws SQLException {
    	return null;
    }

    // Remove comments when compiling with JDK 1.4.0 or above
/*
	public void releaseSavepoint(Savepoint s) throws SQLException {
	}

	public Savepoint setSavepoint() throws SQLException {
		return null;
	}

	public Savepoint setSavepoint(String s) throws SQLException {
		return null;
	}

	public void rollback(Savepoint s) throws SQLException {
	}
*/
	public Statement createStatement(int a, int b, int c) throws SQLException {
		if (a==0 || b==0 || c==0);
		return null;
	}

	public PreparedStatement prepareStatement(String sql) throws SQLException {
		if (sql!=null);
		return null;
    }
	public PreparedStatement prepareStatement(String sql, String[] a) throws SQLException {
		if (sql!=null && a==null);
		return null;
	}
	public PreparedStatement prepareStatement(String sql, int a) throws SQLException {
		if (sql!=null && a==0);
		return null;
	}
	public PreparedStatement prepareStatement(int a) throws SQLException {
		if (a==0);
		return null;
	}
	public PreparedStatement prepareStatement(String sql, int[] a) throws SQLException {
		if (sql!=null && a==null);
		return null;
	}
	public PreparedStatement prepareStatement(String sql, int a, int b, int c)
	throws SQLException {
		if (sql!=null && a==0 && b==0 && c==0);
		return null;
	}
    public CallableStatement prepareCall(String sql) throws SQLException {
    	if (sql!=null);
    	return null;
    }
						
	public CallableStatement prepareCall(String sql, int a, int b, int c) throws SQLException {
		if (sql!=null && a==0 && b==0 && c==0);
		return null;
	}
						
    public String nativeSQL(String sql) throws SQLException {
		if (sql!=null);
    	return null;
    }

    public void setAutoCommit(boolean autoCommit) throws SQLException {
		if (autoCommit);
    }

    public boolean getAutoCommit() throws SQLException {
    	return false;
    }

    public void commit() throws SQLException {
    }

    public void rollback() throws SQLException {
    }

    public void close() throws SQLException {
		closed = true;
    }

    public boolean isClosed() throws SQLException {
    	return closed;
    }

    public DatabaseMetaData getMetaData() throws SQLException {
    	return null;
    }

    public void setReadOnly(boolean readOnly) throws SQLException {
    	if (readOnly);
    } 

    public boolean isReadOnly() throws SQLException {
    	return false;
    }

    public void setCatalog(String catalog) throws SQLException {
    	if (catalog!=null);
    }

    public String getCatalog() throws SQLException {
    	return null;
    }

    public int TRANSACTION_NONE	     = 0;
    public int TRANSACTION_READ_UNCOMMITTED = 1;
    public int TRANSACTION_READ_COMMITTED   = 2;
    public int TRANSACTION_REPEATABLE_READ  = 4;
    public int TRANSACTION_SERIALIZABLE     = 8;

    public void setTransactionIsolation(int level) throws SQLException {
    	if (level==0);
    }

    public int getTransactionIsolation() throws SQLException {
    	return 0;
    }

    public SQLWarning getWarnings() throws SQLException {
    	return null;
    }

    public void clearWarnings() throws SQLException {
    }


    public Statement createStatement(int resultSetType, int resultSetConcurrency) 
      throws SQLException {
    	if (resultSetType==resultSetConcurrency);
    	return null;
    }

    public PreparedStatement prepareStatement(String sql, int resultSetType, 
					int resultSetConcurrency)
       throws SQLException {
    	if (sql==null || resultSetType==0 || resultSetConcurrency==0);
       	return null;
    }

    public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
	throws SQLException {
    	if (sql==null || resultSetType==resultSetConcurrency);
	 	return null;
    }

    public java.util.Map getTypeMap() throws SQLException {
    	return null;
    }

//    public void setTypeMap(java.util.Map map) throws SQLException {
//    	if (map!=null);
//    }

    /* (non-Javadoc)
     * @see java.sql.Connection#setSavepoint()
     */
    public Savepoint setSavepoint() throws SQLException{
      return null;
    }

    /* (non-Javadoc)
     * @see java.sql.Connection#releaseSavepoint(java.sql.Savepoint)
     */
    public void releaseSavepoint(Savepoint savepoint) throws SQLException{
    }

    /* (non-Javadoc)
     * @see java.sql.Connection#rollback(java.sql.Savepoint)
     */
    public void rollback(Savepoint savepoint) throws SQLException{
    }

    /* (non-Javadoc)
     * @see java.sql.Connection#setSavepoint(java.lang.String)
     */
    public Savepoint setSavepoint(String name) throws SQLException{
      return null;
    }

	@Override
	public boolean isWrapperFor(Class<?> arg0) throws SQLException {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public <T> T unwrap(Class<T> arg0) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Blob createBlob() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Clob createClob() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public NClob createNClob() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public SQLXML createSQLXML() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Properties getClientInfo() throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getClientInfo(String name) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean isValid(int timeout) throws SQLException {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void setClientInfo(Properties properties) throws SQLClientInfoException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setClientInfo(String name, String value) throws SQLClientInfoException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
		// TODO Auto-generated method stub
		
	}
}







